package com.yc.simple.dao;

import com.yc.simple.entity.User;
import org.springframework.data.jpa.repository.JpaRepository;
import org.springframework.data.jpa.repository.Query;
import org.springframework.stereotype.Repository;

import java.util.List;
//举例 如果我有如下的查询了 但是我需要条件查询
@Repository
public interface UserDao extends JpaRepository<User,Long> {
    List<User> findByUserNameLike(String userName);

    @Query(value = "select * from (?1)")
    List<User> listBySQL(String sql);
}
